﻿using System;
using System.Collections.Generic;
using visinia.SmartEngine;
using visinia.SmartEngine.SiteMap;
using viWiki.Classes;
using viWiki.Controllers;

namespace viWiki.HttpHandlers
{
    public class SiteMap : BaseSiteMap
    {
        public override List<SiteMapInfo> GenerateSiteMap()
        {
            List<SiteMapInfo> list = new List<SiteMapInfo>();
            // wiki front page
            string wikiFrontpageUrl = WebRoots.GetWebRoot + WikiController.WikiUrlSeparator + ".aspx";
            list.Add(new SiteMapInfo("viWiki", WikiController.WikiUrlSeparator, wikiFrontpageUrl, DateTime.Now, SiteMapInfo.ChangeFreq.Daily));
            // wiki pages
            WikiPageController.GetWikiPages().ForEach(delegate(WikiPage wikipage)            
            {
                list.Add(new SiteMapInfo("viWiki", wikipage.Name, wikipage.Url, wikipage.Date, SiteMapInfo.ChangeFreq.Monthly));                
            });
            return list;
        }        
    }
}
